<template>
  <view class="page-container page" :style="{ 'height': screenHeight + 'px', 'width': screenWidth + 'px' }">
    <view style="flex: 1.2;"></view>
   <view style="flex: 1; display: flex; flex-direction: column; width: 100%; justify-content: center; align-items: center; background-color: #fff; border-radius: 20px 20px 0px 0px">
    <image src="@/static/icon/ic_launcher.png" mode="scaleToFill"
      style="height: 72px; width: 72px; border-radius: 10px;"  />
    <text style="font-size: 14px;color: #232323; margin-top: 7px;">智慧创建2.0</text>
    <text
      style="width: 280px;height: 40px;border-radius: 4px;display: flex;flex-direction: column;justify-content: center;align-items: center;background: #0DA863;box-shadow: 1px 1px 2px 0px rgba(56, 193, 90, 0.5);color: #fff;font-size: 14px;margin-top: 55px;"
      @click="wxLogin">微信授权登录</text>
    <text @click="jumpNormallLogin"
      style="font-size: 14px;color: #0DA863; width: 100%;display: flex;flex-direction: column;justify-content: center;align-items: center;padding-top: 10px;padding-bottom: 10px;">快捷登录</text>
   </view>
  </view>
</template>

<script lang="ts" setup>
import { UserTip } from "@/utils/constants";
import { ref } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { isEmptyString } from "@/utils/tools";
import { wxLogin } from "@/utils/account"
let screenHeight = ref(0);
let screenWidth = ref(0);
//底部容器高度
onLoad(() => {
  uni.getSystemInfo({
    success: (result) => {
      const height = result.windowHeight;
      const width = result.windowWidth;
      screenHeight.value = height;
      screenWidth.value = width;
    },
    fail: (error) => { },
  });
  const token = uni.getStorageSync(UserTip.TOKEN)
  if (!isEmptyString(token)) {
    uni.switchTab({
      url: "/pages/index/index",
    });
  }
})
const jumpNormallLogin = () => {
  uni.redirectTo({
    url: '/subpackages/login/login',
  })
}

</script>

<style lang="less">
.page {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  box-sizing: border-box;
  background-image: url("https://pms.sunbirddata.com.cn:8082/common/image/minprogram-bg.png");
  background-size:100%
}
</style>
@/utils/account